<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 200px;
            height: 200px;
            background: #58a;
        }
    </style>
</head>

<body>
    <div id="ad">

    </div>
    <script>
        let ad = document.getElementById('ad');
        ad.addEventListener('click', function() {
            setTimeout(() => {
                this.style.background = 'pink';
            }, 2000)
        })
        const arr = [1, 6, 9, 10, 100, 25];
        // const reult = arr.filter(function(item) {
        //     if (item % 2 === 0) {
        //         return true;
        //     } else {
        //         return false;
        //     }
        // });
        const rectu = arr.filter(itme => itme % 2 === 0);
        //箭头函数适合与this无关的回调，定时器，数组的方法回调
        //箭头函数不适合与this有关的回调，事件回调，对象方法
    </script>
</body>

</html>